{extend name="public/layout"}
{block name="title"}我的资料{/block}
{block name="head"}
<style>
    html, body {
        background-color: #f5f5f5;
    }

    .big-icon {
        height: 0.3648rem !important;
        width: 0.3648rem !important;
    }

    .btn-block-area {
        margin-top: 3rem;
    }

</style>
{/block}
{block name="content"}

<div class="list bg-white mtl" id="form1">

    <div class="list-item border-b border-t flex">
        <img src="/images/icons/man2.png" alt="" class="big-icon">
        <label for="username">姓名:</label>
        <div class="flex-con">
            <input type="text" id="username" required name="username" value="{$m.username}" class="form-control"
                   placeholder="请输入姓名">
        </div>

    </div>
    <div class="list-item border-b flex">
        <img src="/images/icons/phone.png" alt="" class="big-icon">
        <label for="telephone">电话:</label>
        <div class="flex-con">
            <input type="tel" id="telephone" required name="telephone" value="{$m.telephone}" class="form-control"
                   placeholder="请输入电话">
        </div>
    </div>

</div>
<div class="btn-area btn-block-area">
    <div class="btn-block btn-primary btn-rounded" id="saveBtn">保存提交</div>

    <div id="jumpToCom" class="btn-block btn-primary btn-rounded mtl">我是企业用户</div>
</div>
{:_js('js/phone.js')}
<script>
    $('#saveBtn').on('click', function () {
        c.form('form1', "{:U('saveInfo')}").validate().submit().success(function () {
            location.href = "{:U('index/mine')}";
        });
    });
    $('#jumpToCom').on('click', function () {
        if ("{:empty($m.username)||empty($m.telephone)?'1':''}") {
            ui.msg('请先输入姓名和电话并保存提交');
            return;
        }
        location.href = "{:U('company')}";
    });

</script>

{/block}